import {createRouter, createWebHashHistory} from 'vue-router'
import Layout from '../layout/index.vue'
const router = createRouter({
  history: createWebHashHistory(), // hash模式：createWebHashHistory，history模式：createWebHistory
  routes: [
    {
      path: '/',
      redirect: '/dashboard'
    },
    {
      path: '/dashboard',
      name: 'dashboard',
      component: Layout,
      redirect: '/dashboard/camera',
      meta:{
        title: '仪表盘'
      },
      children:[
        {
          path: '/dashboard/camera',
          name: 'camera',
          component: ()=>import('../views/camera/index.vue'),
          meta:{
            title: '摄像头'
          }
        },
        {
          path: '/dashboard/micPhone',
          name: 'micPhone',
          component: ()=>import('../views/micphone/index.vue'),
          meta: {
            title: '麦克风'
          }
        },
        {
          path: '/dashboard/canvas',
          name: 'canvas',
          component: ()=>import('../views/canvas/index.vue'),
          meta: {
            title: '画板截屏'
          }
        },
        {
          path: '/dashboard/screenShare',
          name: 'share',
          component: ()=>import('../views/screenShare/index.vue'),
          meta: {
            title: '屏幕共享'
          }
        },
        {
          path: '/dashboard/videoFilter',
          name: 'filter',
          component: ()=>import('../views/videoFilter/index.vue'),
          meta: {
            title: '视频滤镜'
          }
        },
        {
          path: '/dashboard/resolution',
          name: 'resolution',
          component: ()=>import('../views/resolution/index.vue'),
          meta:{
            title: '动态分辨率'
          }
        },
        {
          path: '/dashboard/dynamicResolution',
          name: 'dynamicResolution',
          component: ()=>import('../views/resolution/dynamic.vue'),
          meta: {
            title: '无缝调整分辨率'
          }
        },
        {
          path: '/dashboard/AudioVolume',
          name: 'AudioVolume',
          component: ()=>import('../views/volume/index.vue'),
          meta: {
            title: '音量值测算'
          }
        },
        {
          path: '/dashboard/deviceEnum',
          name: 'deviceEnum',
          component: ()=>import('../views/device/index.vue'),
          meta: {
            title: '设备枚举'
          }
        },
        {
          path: '/dashboard/setting',
          name: 'settingsDemo',
          component: ()=>import('../views/settings/index.vue'),
          meta: {
            title: '设置综合案例'
          }
        }
      ]
    }
  ]
})

export default router
